package com.hoshiicloud.common.constant;

/**
 * 退款状态枚举
 *
 * @author Markerccc
 * @date 2019/9/9 - 18:08
 */
public enum RefundStatusEnum {
    /**
     * 无需退款
     */
    NO_NEED_REFUND(0, "无需退款"),

    /**
     * 未退款
     */
    NOT_REFUND(1, "未退款"),

    /**
     * 已部分退款
     */
    PART_OF_THE_REFUND(2, "已部分退款"),

    /**
     * 已全额退款
     */
    FULL_REFUND(3, "已全额退款");

    private int code;

    private String name;

    RefundStatusEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public int getCode() {
        return this.code;
    }

    public String getName() {
        return this.name;
    }

    public static RefundStatusEnum get(int code) {
        for (RefundStatusEnum aparameterStatus : values()) {
            if (aparameterStatus.getCode() == code) {
                return aparameterStatus;
            }
        }
        return null;
    }
}
